<?php
    header("Content-Type:text/html;charset=utf8");
    include("./libs/Smarty.class.php");
    $smarty=new Smarty();
    $mysqli = new Mysqli("172.16.5.211","ssshuang","123456","siku");
    if(mysqli_connect_error()){
        echo mysqli_connect_error();
        exit();
    }
    $sql = "SELECT address,title,price FROM s_index WHERE type='about1'";
    $sql2 = "SELECT address,title,price FROM s_index WHERE type='about2'";
    $sql3 = "SELECT address,title,price FROM s_index WHERE type='about3'";
    $sql4 = "SELECT address,title,price FROM s_index WHERE type='about4'";
    $sql5 = "SELECT address,title,price FROM s_index WHERE type='about5'";
    $sql6 = "SELECT address,title,price FROM s_index WHERE type='about6'";        
    $result = $mysqli->query($sql);
    $result2 = $mysqli->query($sql2);
    $result3 = $mysqli->query($sql3);
    $result4 = $mysqli->query($sql4);
    $result5 = $mysqli->query($sql5); 
    $result6 = $mysqli->query($sql6);        
    if(mysqli_num_rows($result)){
        while($row=mysqli_fetch_assoc($result)){
          $arr[]=$row;
        }
        $data=Array("count"=>1,"list"=>$arr);
    }else{
        $data=Array("count"=>0);
    }
    if(mysqli_num_rows($result2)){
        while($row2=mysqli_fetch_assoc($result2)){
          $arr2[]=$row2;
        }
        $data2=Array("count"=>1,"list"=>$arr2);
    }else{
        $data2=Array("count"=>0);
    }
    if(mysqli_num_rows($result3)){
        while($row3=mysqli_fetch_assoc($result3)){
          $arr3[]=$row3;
        }
        $data3=Array("count"=>1,"list"=>$arr3);
    }else{
        $data3=Array("count"=>0);
    }
    if(mysqli_num_rows($result4)){
        while($row4=mysqli_fetch_assoc($result4)){
          $arr4[]=$row4;
        }
        $data4=Array("count"=>1,"list"=>$arr4);
    }else{
        $data4=Array("count"=>0);
    }
    if(mysqli_num_rows($result5)){
        while($row5=mysqli_fetch_assoc($result5)){
          $arr5[]=$row5;
        }
        $data5=Array("count"=>1,"list"=>$arr5);
    }else{
        $data5=Array("count"=>0);
    }
    if(mysqli_num_rows($result6)){
        while($row6=mysqli_fetch_assoc($result6)){
          $arr6[]=$row6;
        }
        $data6=Array("count"=>1,"list"=>$arr6);
    }else{
        $data6=Array("count"=>0);
    }
    $smarty->assign("about1",$data);    
    $smarty->assign("about2",$data2);
    $smarty->assign("about3",$data3);
    $smarty->assign("about4",$data4);
    $smarty->assign("about5",$data5);
    $smarty->assign("about6",$data6);    
    $smarty->display("curing-baobao.tpl");    